package Day4Zuoye;

import java.io.File;
import java.util.Scanner;

public class Test1 {
    public static void main(String[] args) {
        Scanner input=new Scanner(System.in);
        System.out.println("输入文本文件名:");
        String i=input.nextLine();
        i.endsWith(".txt");
        File file=new File("C:\\Users\\Administrator\\Desktop\\xinjian\\"+i);
        System.out.println(file.exists());
        if (file.exists()){
            file.deleteOnExit();
        }
        System.out.println(file.exists());
    }
}
